﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/adminMasterPage.master" AutoEventWireup="true" CodeFile="editClass.aspx.cs" Inherits="admin_editClass" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
    .style1
    {
        width: 100%;
    }
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div class="Body_Title">
    系统信息管理 》》分类设置</div>
    <table class="style1">
        <tr>
            <td>
                新增分类名</td>
            <td>
                <asp:TextBox ID="tbxClassName" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                父分类名</td>
            <td>
                <asp:DropDownList ID="ddlParentID" runat="server" AutoPostBack="True" 
                    DataSourceID="SqlDataSourceParentClass" DataTextField="c_Name" 
                    DataValueField="cID">
                </asp:DropDownList>
                <asp:SqlDataSource ID="SqlDataSourceParentClass" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:LabInfoManageSystemConnectionString %>" 
                    SelectCommand="SELECT * FROM [classInfo] WHERE ([c_parentID] = @c_parentID)">
                    <SelectParameters>
                        <asp:Parameter DefaultValue="0" Name="c_parentID" Type="Int32" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </td>
        </tr>
        <tr>
            <td>
                操作</td>
            <td>
                <asp:Button ID="btnAdd" runat="server" onclick="btnAdd_Click" Text="确定添加" />
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                分类查看</td>
            <td>
                &nbsp;</td>
        </tr>
</table>
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
    AutoGenerateColumns="False" DataSourceID="SqlDataSourceClass" 
    EnableModelValidation="True" DataKeyNames="cID">
    <Columns>
        <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
        <asp:BoundField DataField="cID" HeaderText="编号" SortExpression="cID" 
            ReadOnly="True" />
        <asp:BoundField DataField="c_Name" HeaderText="分类名" 
            SortExpression="c_Name" />
    </Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSourceClass" runat="server" 
    ConnectionString="<%$ ConnectionStrings:LabInfoManageSystemConnectionString %>" 
    SelectCommand="SELECT * FROM [classInfo] WHERE ([c_parentID] = @c_parentID)" 
        DeleteCommand="DELETE FROM classInfo WHERE (cID = @Param1)" 
        InsertCommand="INSERT INTO classInfo(c_parentID, c_Name) VALUES (@Param1, @Param2)" 
        oninserting="SqlDataSourceClass_Inserting" 
        UpdateCommand="UPDATE classInfo SET c_parentID = @Param1, c_Name = @Param2 WHERE (cID = @Param3)">
    <DeleteParameters>
        <asp:Parameter Name="Param1" />
    </DeleteParameters>
    <InsertParameters>
        <asp:Parameter Name="Param1" />
        <asp:Parameter Name="Param2" />
    </InsertParameters>
    <SelectParameters>
        <asp:ControlParameter ControlID="ddlParentID" Name="c_parentID" 
            PropertyName="SelectedValue" Type="Int32" />
    </SelectParameters>
    <UpdateParameters>
        <asp:Parameter Name="Param1" />
        <asp:Parameter Name="Param2" />
        <asp:Parameter Name="Param3" />
    </UpdateParameters>
</asp:SqlDataSource>
    <br/>

</asp:Content>

